package cn.rkylin.oms.warehouse.stock.vo;

import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.List;

import cn.rkylin.oms.warehouse.stock.domain.Stock;

/**
 * StockVO
 *
 * @author liming
 * @date 2017/10/16
 */
public class StockVO extends Stock {
    private static final String STATUS_CHK = "<input name=\"chk\" myId=\"%s\" goodsId=\"%s\" goodsCode=\"%s\" goodsName=\"%s\" skuId=\"%s\" skuCode=\"%s\" skuName=\"%s\" stockType=\"%s\" batchCode=\"%s\" productDate=\"%s\" type=\"checkbox\" />";
    /**
     * 序列号
     */
    private static final long serialVersionUID = -4803793928598637807L;

    /**
     * searchCondition:快速查询条件.
     */
    private String quickSearch;

    /**
     * orderBy:排序规则.
     */
    private String orderBy;

    /**
     * 可用数
     */
    private Integer available;

    /**
     * 可分派数
     */
    private Integer canallotQty;

    /**
     * 残次品可分派数
     */
    private Integer junkCanallotQty;

    /**
     * 项目Id
     */
    private String prjId;

    /**
     * 单据编码
     */
    private String sourceCode;

    /**
     * 操作标签
     */
    private String tag;

    private String stockType;   //库存类型正品/次品

    private String batchCode;   //批次

    private String productDate; //效期

    private String chk;

    private String myId;

    /**
     * 成本价
     */
    private BigDecimal goodsSkuCost;
    /**
     * idArray：id列表，用于批量操作
     */
    private List<String> idArray = new ArrayList<String>();

    public String getQuickSearch() {
        return quickSearch;
    }

    public void setQuickSearch(String quickSearch) {
        this.quickSearch = quickSearch;
    }

    public String getOrderBy() {
        return orderBy == null ? null : orderBy.replaceAll(".*([';]+|(--)+).*", " ");// 此字段需要防止sql注入
    }

    public void setOrderBy(String orderBy) {
        this.orderBy = orderBy;
    }

    public Integer getCanallotQty() {
        return canallotQty;
    }

    public void setCanallotQty(Integer canallotQty) {
        this.canallotQty = canallotQty;
    }

    public String getPrjId() {
        return prjId;
    }

    public void setPrjId(String prjId) {
        this.prjId = prjId;
    }

    public String getSourceCode() {
        return sourceCode;
    }

    public void setSourceCode(String sourceCode) {
        this.sourceCode = sourceCode;
    }

    public String getTag() {
        return tag;
    }

    public void setTag(String tag) {
        this.tag = tag;
    }

    public Integer getJunkCanallotQty() {
        return junkCanallotQty;
    }

    public void setJunkCanallotQty(Integer junkCanallotQty) {
        this.junkCanallotQty = junkCanallotQty;
    }

    public Integer getAvailable() {
        return available;
    }

    public void setAvailable(Integer available) {
        this.available = available;
    }

    public List<String> getIdArray() {
        return idArray;
    }

    public void setIdArray(List<String> idArray) {
        this.idArray = idArray;
    }

    public String getStockType() {
        return stockType;
    }

    public void setStockType(String stockType) {
        this.stockType = stockType;
    }

    public String getBatchCode() {
        return batchCode;
    }

    public void setBatchCode(String batchCode) {
        this.batchCode = batchCode;
    }

    public String getProductDate() {
        return productDate;
    }

    public void setProductDate(String productDate) {
        this.productDate = productDate;
    }

    public String getChk() {
        return String.format(STATUS_CHK, this.getMyId(),this.getGoodsId(),this.getGoodsCode(),this.getGoodsName(),this.getSkuId(),this.getSkuCode(),this.getSkuName(),this.getStockType(),this.getBatchCode(),this.getProductDate()).toString();
    }

    public void setChk(String chk) {
        this.chk = chk;
    }

    public String getMyId() {
        return myId;
    }

    public void setMyId(String myId) {
        this.myId = myId;
    }

    public BigDecimal getGoodsSkuCost() {
        return goodsSkuCost;
    }

    public void setGoodsSkuCost(BigDecimal goodsSkuCost) {
        this.goodsSkuCost = goodsSkuCost;
    }
}
